package com.example.controller;

import com.example.common.HttpStatusDescriptions;
import com.example.common.ResponseResult;
import com.example.entity.User;
import com.example.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author ccf@lijiaqiang
 * @since 2023-10-26
 */
@RestController
@RequestMapping("user")
public class SysUserController {



    @Autowired
    private SysUserService userService;

    @PostMapping("/login")
    public ResponseResult<?> login(@RequestBody User user) {
        return userService.login(user);
    }

    @PostMapping("/logout")
    public ResponseResult<?> logout() {
        return userService.logout();
    }
}
